projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5ec80eb
)
Protect gtk_text_view_scroll_mark_onscreen() from using invalid marks
author
Kristian Rietveld
<kris@gtk.org>
Fri, 4 Sep 2009 15:40:12 +0000
(17:40 +0200)
committer
Kristian Rietveld
<kris@gtk.org>
Fri, 4 Sep 2009 15:40:12 +0000
(17:40 +0200)
Suggested by Paolo Borelli.
gtk/gtktextview.c
patch
|
blob
|
history
diff --git
a/gtk/gtktextview.c
b/gtk/gtktextview.c
index ad9cba06f4ac5cda5ecd55674b4285a0a64761eb..0c41e24c2163f5cdc2856f1780baf680fa970467 100644
(file)
--- a/
gtk/gtktextview.c
+++ b/
gtk/gtktextview.c
@@
-2194,6
+2194,11
@@
gtk_text_view_scroll_mark_onscreen (GtkTextView *text_view,
g_return_if_fail (GTK_IS_TEXT_VIEW (text_view));
g_return_if_fail (GTK_IS_TEXT_MARK (mark));
+ /* We need to verify that the buffer contains the mark, otherwise this
+ * can lead to data structure corruption later on.
+ */
+ g_return_if_fail (get_buffer (text_view) == gtk_text_mark_get_buffer (mark));
+
gtk_text_view_scroll_to_mark (text_view, mark, 0.0, FALSE, 0.0, 0.0);
}